CREATE TABLE [dbo].[tb_Reclamos]
(
[idReclamo] [int] NOT NULL IDENTITY(1, 1),
[Agente] [int] NOT NULL,
[Fecha] [int] NOT NULL,
[Tipo] [int] NOT NULL,
[Descripcion] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Responsable] [int] NOT NULL,
[Estado] [int] NOT NULL,
[FechaResolucion] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Reclamos] ADD CONSTRAINT [PK_tb_Reclamos] PRIMARY KEY NONCLUSTERED  ([idReclamo]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Reclamos] WITH NOCHECK ADD CONSTRAINT [FK_tb_Reclamos_tb_Agentes] FOREIGN KEY ([Agente]) REFERENCES [dbo].[tb_Agentes] ([idAgente])
GO
ALTER TABLE [dbo].[tb_Reclamos] WITH NOCHECK ADD CONSTRAINT [FK_tb_Reclamos_tb_EstadosDeReclamo] FOREIGN KEY ([Estado]) REFERENCES [dbo].[tb_EstadosDeReclamo] ([IdEstadoDeReclamo])
GO
ALTER TABLE [dbo].[tb_Reclamos] WITH NOCHECK ADD CONSTRAINT [FK_tb_Reclamos_tb_Usuarios] FOREIGN KEY ([Responsable]) REFERENCES [dbo].[tb_Usuarios] ([idUsuario])
GO
ALTER TABLE [dbo].[tb_Reclamos] WITH NOCHECK ADD CONSTRAINT [FK_tb_Reclamos_tb_TiposDeReclamo] FOREIGN KEY ([Tipo]) REFERENCES [dbo].[tb_TiposDeReclamo] ([IdTipoDeReclamo])
GO
ALTER TABLE [dbo].[tb_Reclamos] ADD CONSTRAINT [FK_tb_Reclamos_tb_TiposDeReclamo1] FOREIGN KEY ([Tipo]) REFERENCES [dbo].[tb_TiposDeReclamo] ([IdTipoDeReclamo])
GO
